/**
	@file
	Contains error codes defines. Error codes from 1 to 34 are compatible wit C GNU (and almost all other) compilers.
	Some errors may not be used on OS. Added for compatibility.
	All error codes (except \ref NO_ERROR) have their synonyms wit ERR prefix and long names (much more readable).
	Error codes starting at 35 and above are specific to our OS

	@author Konstantin Kastanov
*/
#ifndef ERRNO_H
#define ERRNO_H



#define NUMBER_OF_ERROR_CODES			44  /**< Number of defined error codes. 
												Used to validate error code value. Excludes ERR_UNKNOWN */

#define NO_ERROR						0
#define EPERM							1	/**< Operation not permitted */
#define ERR_OPERATION_NOT_PERMITTED		1
#define ENOENT							2	/**< No such file or directory */
#define ERR_FILE_NOT_EXIST				2
#define ESRCH							3	/**< No such process */
#define ERR_PROCESS_NOT_EXIST			3
#define EINTR							4	/**< Interrupted system call */
#define ERR_INTERRUPTED_SYSTEM_CALL		4		
#define EIO								5	/**< I/O error */
#define ERR_IO							5
#define ENXIO							6	/**< No such device or address */
#define ERR_DEVICE_NOT_FOUND			6
#define E2BIG							7	/**< Argument list too long */
#define ERR_TOO_LARGE_ARG_LIST			7
#define ENOEXEC							8	/**< Executable format error */
#define ERR_WRONG_EXEC_FORMAT			8
#define EBADF							9	/**< Bad file number */
#define ERR_BAD_FILE_NUMBER				9
#define ECHILD							10	/**< No child processes */
#define ERR_NO_CHILD_PROC				10
#define EAGAIN							11	/**< Try again */
#define ERR_TRY_AGAIN					11
#define ENOMEM							12	/**< Out of memory */
#define ERR_OUT_OF_MEMORY				12
#define EACCES							13	/**< Permission denied */
#define ERR_PERMISSION_DENIED			13
#define EFAULT							14	/**< Bad address */
#define ERR_BAD_ADDRESS					14
#define ENOTBLK							15	/**< Block device required */
#define ERR_NOT_BLOCK					15
#define EBUSY							16	/**< Device or resource busy */
#define ERR_BUSY						16
#define EEXIST							17	/**< File exists */
#define ERR_FILE_EXIST					17
#define EXDEV							18	/**< Cross-device link */
#define ERR_CROSS_DEV_LINK				18
#define ENODEV							19	/**< No such/wrong device */
#define ERR_WRONG_DEVICE				19
#define ENOTDIR							20	/**< Not a directory */
#define ERR_NOT_DIR						20
#define EISDIR							21	/**< Is a directory */
#define ERR_IS_DIR						21
#define EINVAL							22	/**< Invalid argument */
#define ERR_INVALID_ARG					22
#define ENFILE							23	/**< File table overflow */
#define ERR_FILE_TABLE_OVERFLOW			23
#define EMFILE							24	/**< Too many open files */
#define ERR_TOO_MANY_OPEN_FILES			24
#define ENOTTY							25	/**< Not a typewriter, inappropriate IO operation */
#define ERR_NOT_TYPEWRITER				25
#define ETXTBSY							26	/**< Text file busy */
#define ERR_FILE_BUSY					26
#define EFBIG							27	/**< File too large */
#define ERR_FILE_TOO_LARGE				27
#define ENOSPC							28	/**< No space left on device */
#define ERR_NO_SPACE					28
#define ESPIPE							29	/**< Illegal seek */
#define ERR_ILLEGAL_SEEK				29
#define EROFS							30	/**< Read-only file system */
#define ERR_READ_ONLY					30
#define EMLINK							31	/**< Too many links */
#define ERR_TOO_MANY_LINKS				31
#define EPIPE							32	/**< Broken pipe */
#define ERR_PIPE_BROKEN					32
#define EDOM							33	/**< Math argument out of domain of func */
#define ERR_MATH_ARG_OUT_OF_DOMAIN		33
#define ERANGE							34	/**< Math result not representable */
#define ERR_MATH_RES_NOT_REPRESENTABLE	34

#define ERR_ALREADY_MOUNTED				35	/**< Partition already mounted */
#define ERR_PARTITION_NOT_FOUND			36	/**< Partition not found */
#define ERR_TOO_MANY_PARTITIONS_MOUNTED	37	/**< Too many partitions mounted */
#define ERR_NOT_ALLOCATED				38  /**< Memory was not allocated*/
#define ERR_HEAP_DAMAGED				39  /**< Heap structure damaged*/
#define ERR_IS_EMPTY					40  /**< Data structure (list, queue, etc.) is empty*/
#define ERR_OUT_OF_BOUNDS				41
#define ERR_ELEMENT_NOT_FOUND			42
#define ERR_HEAP_INDEX_OVERFLOW			43
#define ERR_UNKNOWN						0xFF /**< Unknown error */



#endif